import request from "@/utils/request";

const api_name = "/person";

export default {
  getPersonInfo() {
    return request({
      url: `${api_name}/getPersonInfo`,
      method: "get",
    });
  },
  getPersonById(userId, identity) {
    return request({
      url: `${api_name}/getPersonById`,
      method: "get",
      params: {
        userId,
        identity,
      },
    });
  },
  updateStudentInfo(studentInfo) {
    return request({
      url: `${api_name}/updateStudentInfo`,
      method: "post",
      data: studentInfo,
    });
  },
  updateTeacherInfo(teacherInfo) {
    return request({
      url: `${api_name}/updateTeacherInfo`,
      method: "post",
      data: teacherInfo,
    });
  },
  getPersonArticle() {
    return request({
      url: `${api_name}/getPersonArticle`,
      method: "get",
    });
  },
  getPersonArticleById(userId, identity) {
    return request({
      url: `${api_name}/getPersonArticleById`,
      method: "get",
      params: {
        userId,
        identity,
      },
    });
  },
  getPersonComment() {
    return request({
      url: `${api_name}/getPersonComment`,
      method: "get",
    });
  },
  addFriend(friendId) {
    return request({
      url: `${api_name}/addFriend`,
      method: "post",
      params: {
        friendId,
      },
    });
  },
  getMessageCount(type) {
    return request({
      url: `${api_name}/getMessageCount`,
      method: "get",
      params: {
        type,
      },
    });
  },
};
